package com.example.yunifang.adapter;

import java.util.ArrayList;
import com.example.yunifang.R;
import com.example.yunifang.bean.XiangQingBean;
import com.example.yunifang.bean.XiangQingBean.Data.Activity1;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class MyXiangQingAdapter extends BaseAdapter {
	ArrayList<Activity1> data;
	Context context;
	
	public MyXiangQingAdapter(ArrayList<Activity1> data, Context context) {
		super();
		this.data = data;
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return data.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return data.get(arg0);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View view=View.inflate(context, R.layout.xiangqing_lv_list_item, null);
		TextView name=(TextView) view.findViewById(R.id.xiangqing_lv_item_tv);
		name.setText(data.get(position).title);
		return view;
	}

}
